Tidy error message.
authorEwan Mellor <ewan@xensource.com>
Mon, 4 Dec 2006 10:27:23 +0000 (10:27 +0000)
committerEwan Mellor <ewan@xensource.com>
Mon, 4 Dec 2006 10:27:23 +0000 (10:27 +0000)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendDomainInfo.py

index 0aa71fc4e6882359e1a4028f79489b2a90f13395..5488b17f8f2a532f9e36eefbb9ef97d398f7b3f5 100644 (file)
@@ -1709,8 +1709,10 @@ class XendDomainInfo:
 
         dom =  XendDomain.instance().domain_lookup_nr(name)
         if dom and dom.info['uuid'] != self.info['uuid']:
-            raise VmError("VM name '%s' already exists as domain %s" %
-                          (name, str(dom.domid)))
+            raise VmError("VM name '%s' already exists%s" %
+                          (name,
+                           dom.domid is not None and
+                           ("as domain %s" % str(dom.domid)) or ""))
         
 
     def update(self, info = None, refresh = True):